﻿function Zombie(point, name) {
    this.init(point, name);
    this.moveAmount = Zombie.baseMoveAmount;
    this.smallMarker = new GMarker(this._curPoint, { icon: Zombie.smallMapIcon, zIndexProcess: function(){return -50;} });
    this.setMarkerStanding();
}
Zombie.inheritsFrom(Creature);

//Static properties
if(!DEBUG)Zombie.baseMoveAmount = .00006;else Zombie.baseMoveAmount = .0002;
Zombie.maxHealth = 3;
Zombie.value = 1; //Value of killing
Zombie.damagePower = 1;

//Must use a function for this to create unique gif names
Zombie.getDeathIcon = function(){
	var deadIcon = new GIcon(G_DEFAULT_ICON);
	deadIcon.shadow = "";
	deadIcon.image = "http://labs.ribaudio.com/herosquad/img/v2/zombiedie.gif?" + (++Creature.uniqueCount);
	deadIcon.iconSize = new GSize(50, 70);
	deadIcon.iconAnchor = new GPoint(25, 60);
	return deadIcon;
}

//Static icon properties
var smallMapIcon = new GIcon(G_DEFAULT_ICON);
smallMapIcon.image = "http://labs.ribaudio.com/herosquad/img/v2/zombiemarker.png";
smallMapIcon.shadow = "";
smallMapIcon.iconSize = new GSize(20, 20);
smallMapIcon.iconAnchor = new GPoint(10, 10);
Zombie.smallMapIcon = smallMapIcon;

var standingIcon = new GIcon(G_DEFAULT_ICON);
standingIcon.shadow = "http://labs.ribaudio.com/herosquad/img/v2/zombiestand.png";
standingIcon.shadowSize = new GSize(50, 70);
standingIcon.image = Creature.imgHealth100;
standingIcon.iconSize = new GSize(50, 70);
standingIcon.iconAnchor = new GPoint(25, 60);
Zombie.standingIcon = standingIcon;

var walkingIcon = new GIcon(G_DEFAULT_ICON);
walkingIcon.shadow = "http://labs.ribaudio.com/herosquad/img/v2/zombiewalk.gif";
walkingIcon.shadowSize = new GSize(50, 70);
walkingIcon.image = Creature.imgHealth100;
walkingIcon.iconSize = new GSize(50, 70);
walkingIcon.iconAnchor = new GPoint(25, 60);
Zombie.walkingIcon = walkingIcon;


//Instance methods
Zombie.prototype.performActionAtTarget = function() {
    this.onExploded.fire();
}